package com.heima.article.feign;

import com.heima.model.behavior.dtos.BehaviorEntryDto;
import com.heima.model.behavior.pojos.ApBehaviorEntry;
import com.heima.model.behavior.pojos.ApLikesBehavior;
import com.heima.model.behavior.pojos.ApUnlikesBehavior;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @作者 itcast
 * @创建日期 2020/10/8 15:39
 **/
@FeignClient("leadnews-behavior")
public interface BehaviorFeign {
    /**
     * 根据用户ID 或 设备ID获取行为实体
     * @return
     */
    @GetMapping("/api/v1/behavior_entry/one")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam("userId") Integer userId,@RequestParam("equipmentId") Integer equipmentId);

    /**
     * 获取点赞行为
     * @param articleId
     * @param entryId
     * @param type
     * @return
     */
    @GetMapping("/api/v1/likes_behavior/one")
    public ApLikesBehavior findLikeByArticleIdAndEntryId(@RequestParam("articleId") Long articleId,
                                                         @RequestParam("entryId") Integer entryId,
                                                         @RequestParam("type") Short type);
    /**
     * 获取不喜欢行为
     * @param articleId
     * @param entryId
     * @return
     */
    @GetMapping("/api/v1/unlike_behavior/one")
    public ApUnlikesBehavior findUnLikeByArticleIdAndEntryId(@RequestParam("articleId") Long articleId,
                                                             @RequestParam("entryId") Integer entryId);
}
